{% extends "base.htm" %}

{% block header_title %}文章发表{% end %}
{% block body %}
{% include "header.htm" %}

<div class="am-container">
    <div class="am-g">
        <form class="am-form" id="minos-pulish" method="post">
            <div class="am-input-group am-margin-bottom" id="title-form">
              <span class="am-input-group-label">文章标题</span>
              <input type="text" name="title" class="am-form-field" >
            </div>
            <div class="am-form-group am-margin-bottom minos-width-6">
              <div class="am-fl am-input-group-label am-hide-sm-only">板块</div>
              <div class="am-fl minos-dropdown">
                  <select name="sort" data-am-selected>
                    {% for row in sort %}
                    <option value="{{ row['_id'] }}">{{ row['name'] }}</option>
                    {% end %}
                  </select>
              </div>
              <span class="am-form-caret am-cf"></span>
            </div>
            {% set text = flash["article"] %}
            <textarea id="editor" name="ckeditor">{{ text }}</textarea>
            <div class="am-padding-top"></div>
            <div class="am-g">
                <div class="am-input-group am-u-sm-12 am-u-md-4 am-u-lg-4">
                  <span class="am-input-group-label">收费</span>
                  <input type="text" class="am-form-field" name="charge" value="0">
                  <span class="am-input-group-label">金币</span>
                </div>
                <div class="am-u-md-8 am-u-lg-8 am-hide-sm-only am-g-collapse">
                  <div class="am-input-group am-u-sm-6">
                    <span class="am-input-group-label">免费时段</span>
                    <input type="number" class="am-form-field" name="freebegin" placeholder="0">
                  </div>
                  <div class="am-input-group am-u-sm-6">
                    <span class="am-input-group-label">到</span>
                    <input type="number" class="am-form-field" name="freeend" placeholder="2">
                  </div>

                </div>
            </div>
            <div class="am-padding-top"></div>
            <a class="am-btn am-btn-success" id="publish">立即发布</a>
            <a class="am-btn am-btn-default" id="save">临时保存</a>
            {% raw xsrf_form_html() %}
        </form>
    </div>
</div>


{% end %}
{% block header_static %}
<link rel="stylesheet" href="{{ static_url('assets/simditor/styles/simditor.css') }}">
{% end %}

{% block footer_static %}
<script src="{{ static_url('assets/simditor/scripts/module.js') }}"></script>
<script src="{{ static_url('assets/simditor/scripts/hotkeys.js') }}"></script>
<script src="{{ static_url('assets/simditor/scripts/uploader.js') }}"></script>
<script src="{{ static_url('assets/simditor/scripts/simditor.js') }}"></script>
<script src="{{ static_url('assets/js/publish.js') }}"></script>
<script src="{{ static_url('assets/js/app.js') }}"></script>
{% end %}